package com.ml.loan.sys.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ml.loan.sys.model.SysOperRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 操作日志 Mapper 接口
 * </p>
 *
 * @author milian
 * @since 2022-08-22
 */
@Mapper
public interface SysOperRecordMapper extends BaseMapper<SysOperRecord> {

    @Select("select r.id,r.user_id,r.model,r.description,r.url,r.request_method,r.oper_method,r.ip,r.spend_time,r.state,r.user_type,r.create_time,u.username,u.nick_name from sys_oper_record r " +
            "left join sys_user u on u.user_id = r.user_id ${ew.customSqlSegment} ")
    List<SysOperRecord> list(Page<SysOperRecord> pageinfo, @Param(Constants.WRAPPER) QueryWrapper<SysOperRecord> wrapper);
}
